package com.wanxi.test;

public class Water {
    public static void main(String[] args) {
        /**
         * 理解什么是水仙花？
         * 1.初始化开始  100
         * 2.结束不等于1000
         * 3.控制语句 +1
         * 4.判断
         * 5.计算个十百位的立方和
         */
        int time=0;
        for (int i = 100; i < 1000; i++) {
            int ge = i % 10;
            int shi = i / 10 % 10;
            int bai = i / 100 % 10;
            if (ge * ge * ge + shi * shi * shi + bai * bai * bai == i) {
                System.out.println(i);
                time++;
            }
        }
        System.out.println(time+"次");
    }
}
